/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package mouseident;

import java.awt.Color;

/**
 *
 * @author matze
 */
public class Node {

    int x,y;
    boolean visited = false;
    Color color;

    public Node(int X, int Y, Color color) {
        this.x = X;
        this.y = Y;
        this.color = color;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public boolean isVisited() {
        return visited;
    }

    public void setVisited(boolean Visited) {
        visited = Visited;
    }

    public Color getColor() {
        return color;
    }

    /**
     * returns true if the given coordinates are in the area of the dot. (assuming a radius of 10.
     * false otherwise.
     * @param ax
     * @param ay
     * @return boolean
     */
    public boolean isInArea (int X, int Y) {
        double dx = x - X;
        double dy = y - Y;
        double d =  Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
        return (d<=11);
    }

    public boolean overlaps(Node o) {
        double dx = x - o.getX();
        double dy = y - o.getY();
        double d =  Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
        return (d<=22);
    }

}
